home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / powerd / source / lib / powerd_lib.lha / PowerD_PPC / StrAdd.ass < prev    next >
Text File  |  2000-10-15  |  548b  |  28 lines

  1.  
  2. # StrAdd(r3:PTR TO CHAR,r4:PTR TO CHAR,r5=-1:LONG)
  3.  
  4.     .text
  5.     .global    _StrAdd
  6.  
  7. _StrAdd:
  8.     subi    r6,r3,1        # find the end of the destination string
  9. .find:    lbzu    r0,1(r6)
  10.     mr.    r0,r0
  11.     bne    .find
  12.  
  13.     subi    r4,r4,1
  14.     subi    r6,r6,1
  15. .loop:    lbzu    r0,1(r4)        # get char from source
  16.     stbu    r0,1(r6)        # put char to destination
  17.     mr.    r0,r0        # source end?
  18.     beq    .finish
  19.     subi    r5,r5,1        # length done?
  20.     mr.    r5,r5
  21.     bne    .loop
  22.     li    r0,0        # finish with zero byte
  23.     stb    r0,1(r6)
  24. .finish:    blr            # r3 contains destination string pointer
  25.  
  26.     .type    _StrAdd,@function
  27.     .size    _StrAdd,$-_StrAdd
  28.